package org.dromara.crawler.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.domain.R;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.web.core.BaseController;
import org.dromara.crawler.domain.CrawlerTask;
import org.dromara.crawler.mongo.mongodomain.CrawlerLogs;
import org.dromara.crawler.mongo.mongoservice.CrawlerLogsService;
import org.dromara.crawler.mongo.mongoservice.HistoricalDataService;
import org.dromara.crawler.service.CrawlerTaskService;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 历史数据接口
 *
 * @author shup
 */
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/historicalData")
public class HistoricalDataController extends BaseController {

    private final HistoricalDataService historicalDataService;


    /**
     * 获取历史统计数据
     * @return
     */
    @GetMapping("/getHistoricalStatData")
    public R<Map<String,Object>> getHistoricalStatData() {
        return R.ok(historicalDataService.statistics());
    }


}
